package com.t235.gc.dao;

import com.t235.gc.entity.GarbageRecyclingOrder;
import com.t235.gc.vo.RecyclingOrderVo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 垃圾回收订单表(GarbageRecyclingOrder)表数据库访问层
 *
 * @author makejava
 * @since 2021-03-24 08:45:29
 */
public interface GarbageRecyclingOrderDao {

    /**
     * 通过ID查询单条数据
     *
     * @param orderid 主键
     * @return 实例对象
     */
    GarbageRecyclingOrder queryById(Long orderid);

    /**
     * 查询指定行数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    List<GarbageRecyclingOrder> queryAllByLimit(@Param("offset") int offset, @Param("limit") int limit);


    /**
     * 通过实体作为筛选条件查询
     *
     * @param garbageRecyclingOrder 实例对象
     * @return 对象列表
     */
    List<GarbageRecyclingOrder> queryAll(GarbageRecyclingOrder garbageRecyclingOrder);

    /**
     * 新增数据
     *
     * @param garbageRecyclingOrder 实例对象
     * @return 影响行数
     */
    int insert(GarbageRecyclingOrder garbageRecyclingOrder);

    /**
     * 批量新增数据（MyBatis原生foreach方法）
     *
     * @param entities List<GarbageRecyclingOrder> 实例对象列表
     * @return 影响行数
     */
    int insertBatch(@Param("entities") List<GarbageRecyclingOrder> entities);

    /**
     * 批量新增或按主键更新数据（MyBatis原生foreach方法）
     *
     * @param entities List<GarbageRecyclingOrder> 实例对象列表
     * @return 影响行数
     */
    int insertOrUpdateBatch(@Param("entities") List<GarbageRecyclingOrder> entities);

    /**
     * 修改数据
     *
     * @param garbageRecyclingOrder 实例对象
     * @return 影响行数
     */
    int update(GarbageRecyclingOrder garbageRecyclingOrder);

    /**
     * 通过主键删除数据
     *
     * @param orderid 主键
     * @return 影响行数
     */
    int deleteById(Long orderid);

    List<GarbageRecyclingOrder> getList(@Param("vo") RecyclingOrderVo vo);

    int getCount(@Param("vo") RecyclingOrderVo vo);

    int deleteByPrimaryKey(Long orderid);

    int insertSelective(GarbageRecyclingOrder record);

    GarbageRecyclingOrder selectByPrimaryKey(Long orderid);

    int updateByPrimaryKeySelective(GarbageRecyclingOrder record);

    int updateByPrimaryKey(GarbageRecyclingOrder record);

    List<GarbageRecyclingOrder> select(@Param("garbageRecyclingOrder") GarbageRecyclingOrder garbageRecyclingOrder,
                                       @Param("nickname")String nickname,
                                       @Param("userphone")String userphone,
                                       @Param("begindate") Date begindate,
                                       @Param("finishdate")Date finishdate,
                                       @Param("recyclingtype")Integer recyclingtype);

    List<GarbageRecyclingOrder> selectAll();

    void insertGarbageRecyclingOrder(GarbageRecyclingOrder garbageRecyclingOrder);

    void updateGarbageRecyclingOrder(@Param("orderid") Long orderid,@Param("recyclingweight") Integer recyclingweight,@Param("accpoints") Integer accpoints);

    GarbageRecyclingOrder selectAccPointsByUserId(Long userid);
}

